import os
import sys
from _mainlib import sleep
import api_read

name = api_read.start()['taskname']
clic = api_read.start()['clic']
while True:
    if os.popen(f'Tasklist | findstr "{name}.exe"').read() != '':
        os.popen(f'taskkill /im {name} /f')
        if clic == False:
            sys.exit()
    sleep(5)
    
